<?php

use think\facade\Route;

Route::miss(function () {
    return '404 Not Found!';
});


Route::group('api', function () {
    // 获取管理员列表
    Route::get('admin', '/api/admin/adminList');
    // 登录
    Route::post('login', '/api/login/login');
    // 获取验证码
    Route::post('registerCode', '/api/login/registerCode');
    // 密码注册
    Route::post('register', '/api/login/register');

    Route::group('/', function () {
        // 获取用户信息
        Route::get('info', '/api/info/infoAvatar');
    })->middleware(\app\api\middleware\CheckToken::class);

    Route::group('nav', function () {
        Route::get('bottomList', '/api/BottomNav/bottomList');
    });


    Route::group('Wallpaper', function () {
        // 获取二级菜单里面的头像的资源
        Route::get('headImage', '/api/Wallpaper/head');
        // 获取一级菜单的列表
        Route::get('topNav', 'api/Wallpaper/topNav');
        // 点击一级菜单id获取二级菜单
        Route::get('twoList', '/api/Wallpaper/twoList');
    });
     Route::group('forumessay', function () {
        // 获取论坛文章列表
        Route::get('list', '/api/ForumEssay/index');
    });

     Route::group('settime', function () {
        // 开始
        Route::get('begin', '/api/Settime/index');
    });

     Route::group('upload', function () {
        // 上传图片aliyun
        Route::post('upload', '/api/UploadPhone/index');
    });
})->allowCrossDomain([
    'Access-Control-Allow-Headers' => 'token',
]);

